﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using X.Web;

namespace X.WebSite.Admin.Param
{
    public partial class PriceList : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }

        void BindData()
        {
            gvPriceList.DataSource = Bll.Product.GetPriceList();
            gvPriceList.DataBind();
        }

        protected void gvPriceList_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int id = int.Parse(gvPriceList.DataKeys[e.RowIndex].Value.ToString());

            Bll.Product.DeletePrice(id);

            BindData();
        }
    }
}